#include<stdio.h> 
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{	
	int m50=0,m10=0,m5=0,m1=0;
	   while(n>=50)
	   {
		   m50++;
		   n=n-50;
	   } 
	    while(n>=10)
	   {
		   m10++;
		   n=n-10;
	   }
	   while(n>=5)
	   {
		   m5++;
		   n=n-5;
	   }
	    while(n>=1)
	   {
	    	m1++;
		    n=n-1;
       }	
        printf("%d %d %d %d\n",m50,m10,m5,m1);
    }
    return 0;
}
